#include <iostream>

#include "binary_search.h"

using namespace std;
using namespace ads;

int main(int argc, char *argv[]) {
  int a1[] = {1, 3, 5, 9, 11};
  int a1_size = sizeof(a1) / sizeof(int);
  int a2[] = {0, 200, 300};
  int a2_size = sizeof(a2) / sizeof(int);
  int a3[] = {20};
  int a3_size = sizeof(a3) / sizeof(int);

  cout << "A1 search: " << a1[BinarySearch::nearest(a1, 0, a1_size - 1, 6)] << endl;
  cout << "A1 search again: " << a1[BinarySearch::nearest(a1, 0, a1_size - 1, 8)] << endl;
  cout << "A2 search: " << a2[BinarySearch::nearest(a2, 0, a2_size - 1, 103)] << endl;
  cout << "A3 search: " << a3[BinarySearch::nearest(a3, 0, a3_size - 1, 200)] << endl;

  return 0;
}
